package com.agger.eurekacommonapi.hystrix;

import com.agger.eurekacommonapi.service.BaseManagerController;
import com.agger.eurekacommonapi.service.BaseUserController;
import com.agger.eurekacommonapi.vo.ResultData;
import com.agger.eurekacommonapi.vo.UserVO;
import org.springframework.stereotype.Component;

/**
 * @classname: BaseHystrix
 * @description: 熔断器 统一处理（一定到在服务调用方开启配置，并且在启动类中配置@ComponentScan注解，否则扫描不到此熔断器）
 * @author chenhx
 * @date 2020-04-23 15:01:25
 */
@Component
public class BaseHystrix implements BaseUserController, BaseManagerController {
    @Override
    public String helloManager(String name) {
        return "服务熔断，调用失败";
    }

    @Override
    public String helloManager2(String name) {
        return "服务熔断，调用失败";
    }

    @Override
    public String sayHello(String name) {
        return "服务熔断，调用失败";
    }

    @Override
    public String queryUser(String name) {
        return "服务熔断，调用失败";
    }

    @Override
    public String queryUserById(String id) {
        return "服务熔断，调用失败";
    }

    @Override
    public ResultData addUser(UserVO user) {
        return ResultData.FAILED("服务熔断，调用失败");
    }

    @Override
    public String headMan(String man, String foo) {
        return "服务熔断，调用失败";
    }
}
